// ----------------------------------
// RSDK Project: Sonic Essence
// Script Description: FG Detail
// Script Author: Xanman
// ----------------------------------

// Aliases
private alias 24 : TYPE_FGDETAIL

// Function declarations
reserve function FGDETAIL_DebugDraw
reserve function FGDETAIL_DebugSpawn

function FGDETAIL_DebugDraw
	DrawSprite(0)
end function


function FGDETAIL_DebugSpawn
	CreateTempObject(TypeName[FG Detail], 0, object.xpos, object.ypos)
	object[tempObjectPos].drawOrder = 6
end function


event ObjectMain
	object.priority = PRIORITY_ACTIVE
end event


event ObjectDraw
	if object.rotation != 0
		DrawSpriteFX(object.propertyvalue, FX_ROTOZOOM, object.xpos, object.ypos)
	else
		DrawSpriteFX(object.propertyvalue, FX_FLIP, object.xpos, object.ypos)
	endif
end event


event ObjectStartup
	foreach (TypeName[FG Detail], arrayPos0, ALL_ENTITIES)
		object[arrayPos0].priority = PRIORITY_ACTIVE
	next
	LoadSpriteSheet("WIZ/Objects.gif")

	// Ring frames

	SpriteFrame(-8,-85,74,92, 113, 419)
	SpriteFrame(-8,-142,40,148, 72, 363)
	SpriteFrame(-16,-15, 36, 30, 1, 462)
	SpriteFrame(-8,-40,36,47, 6, 391)
	SpriteFrame(-8,-153,29,160, 42, 332)



	// Add the Ring to the debug mode object list
	SetTableValue(TypeName[FG Detail], DebugMode_ObjCount, DebugMode_TypesTable)
	SetTableValue(FGDETAIL_DebugDraw, DebugMode_ObjCount, DebugMode_DrawTable)
	SetTableValue(FGDETAIL_DebugSpawn, DebugMode_ObjCount, DebugMode_SpawnTable)
	DebugMode_ObjCount++
	
end event

event RSDKDraw
	DrawSprite(0)
end event

event RSDKLoad
	LoadSpriteSheet("Global/Display.gif")
	SpriteFrame(-16, -16, 32, 32, 1, 143)
end event
